<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout/blank"><!-- layout文件路径-->
<head>
    <title>发布电影</title>
</head>
<body>
<div layout:fragment="content">
    <div class="content-frame">
        <div class="content-frame-right" >
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">上传资料</h3>
                            <ul class="panel-controls">
                                <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                            </ul>
                        </div>

                        <div class="panel-body">
                            <h4>上传封面:</h4>
                            <div class="block push-up-10">
                                <form id="coverForm" class="dropzone dropzone-mini dz-clickable"><div class="dz-default dz-message"><span>上传截图</span></div></form>
                            </div>
                            <h4>上传截图:</h4>
                            <div class="block push-up-10">
                                <form id="imageForm" class="dropzone dropzone-mini dz-clickable"><div class="dz-default dz-message"><span>上传截图</span></div></form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-frame-body content-frame-body-left">

            <div class="row">
                <div class="col-md-12">

                    <form class="form-horizontal" action="/movie/save" method="post">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title" th:if="${isEdit} eq 'add'">新增影片</h3>
                                <h3 class="panel-title" th:if="${isEdit} eq 'edit'">编辑影片</h3>
                                <ul class="panel-controls">
                                    <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                                </ul>
                            </div>

                            <div class="panel-body">

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">片名</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" class="form-control" name="movieName" th:if="${isEdit} eq 'add'"/>
                                            <input type="text" class="form-control" name="movieName" th:value="${movie.movieName}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">这里填写影片名字</span>
                                    </div>
                                </div>
                                <input type="hidden" name="id"   th:if="${isEdit} eq 'add'"/>
                                <input type="hidden" name="id"  th:value="${movie.id}" th:if="${isEdit} eq 'edit'"/>

                                <input type="hidden" name="logo" id="logoInput"  th:if="${isEdit} eq 'add'"/>
                                <input type="hidden" name="logo" id="logoInput" th:value="${movie.logo}" th:if="${isEdit} eq 'edit'"/>

                                <input type="hidden" name="image" id="imageInput" th:if="${isEdit} eq 'add'"/>
                                <input type="hidden" name="image" id="imageInput" th:value="${movie.image}" th:if="${isEdit} eq 'edit'"/>
                                <input type="hidden" name="url" th:value="${object}"/>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">类型</label>
                                    <div class="col-md-6 col-xs-12">
                                        <select class="form-control select" name="type" th:if="${isEdit} eq 'add'">
                                            <option th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_TYPE'}" th:value="${dic.keyValue}" th:text="${dic.caption}" ></option>
                                        </select>
                                        <select class="form-control select" name="type" th:if="${isEdit} eq 'edit'">
                                            <option th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_TYPE'} " th:selected="${dic.keyValue==movie.type}" th:value="${dic.keyValue}" th:text="${dic.caption}" ></option>
                                        </select>
                                        <span class="help-block">请选择影片类型，必填</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">地区</label>
                                    <div class="col-md-6 col-xs-12">
                                            <select class="form-control select" name="area" th:if="${isEdit} eq 'add'">
                                                <option th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_AREA'}" th:value="${dic.keyValue}" th:text="${dic.caption}" ></option>
                                            </select>
                                            <select class="form-control select" name="area" th:if="${isEdit} eq 'edit'">
                                                <option th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_AREA'} " th:selected="${dic.keyValue==movie.area}" th:value="${dic.keyValue}" th:text="${dic.caption}" ></option>
                                            </select>
                                        <span class="help-block">请选择影片地区，必填</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">淸晰度</label>
                                    <div class="col-md-6 col-xs-12">
                                        <select class="form-control select" name="clarity" th:if="${isEdit} eq 'add'">
                                            <option th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_CLARITY'}" th:value="${dic.keyValue}" th:text="${dic.caption}" ></option>
                                        </select>
                                        <select class="form-control select" name="clarity" th:if="${isEdit} eq 'edit'">
                                            <option th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_CLARITY'} " th:selected="${dic.keyValue==movie.clarity}" th:value="${dic.keyValue}" th:text="${dic.caption}" ></option>
                                        </select>
                                        <span class="help-block">请选择影片淸晰度，必填</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">角标</label>
                                    <div class="col-md-6 col-xs-12">
                                        <select class="form-control select" name="tag" th:if="${isEdit} eq 'add'">
                                            <option th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_TAG'}" th:value="${dic.keyValue}" th:text="${dic.caption}" ></option>
                                        </select>
                                        <select class="form-control select" name="tag" th:if="${isEdit} eq 'edit'">
                                            <option th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_TAG'} " th:selected="${dic.keyValue!=movie.tag}" th:value="${dic.keyValue}" th:text="${dic.caption}" ></option>
                                        </select>
                                        <span class="help-block">请选择影片角标，选填</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">价格</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-cny"></span></span>
                                            <input type="" class="form-control" required="true" min="0" max="100" name="price" step="0.01"  th:if="${isEdit} eq 'add'"/>
                                            <input type="" class="form-control" required="true" min="0" max="100" name="price" step="0.01" th:value="${movie.price}" th:if="${isEdit} eq 'edit'" />
                                        </div>
                                        <span class="help-block">这里填写影片价格</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">导演</label>
                                    <div class="col-md-6 col-xs-12">
                                        <input type="text" class="tagsinput" name="director"  th:if="${isEdit} eq 'add'"/>
                                        <input type="text" class="tagsinput" name="director" th:value="${movie.director}" th:if="${isEdit} eq 'edit'" />
                                        <span class="help-block">填写导演，回车分开</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12  control-label">演员</label>
                                    <div class="col-md-6 col-xs-12">
                                        <input type="text" class="tagsinput" placeholder="演员" name="actor" th:if="${isEdit} eq 'add'"/>
                                        <input type="text" class="tagsinput" placeholder="演员" name="actor" th:value="${movie.actor}" th:if="${isEdit} eq 'edit'"/>
                                        <span class="help-block">填写演员，回车分开</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">上映时间</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-clock-o"></span></span>
                                            <input type="number" class="form-control" required="true" name="year" th:if="${isEdit} eq 'add'"/>
                                            <input type="number" class="form-control" required="true" name="year" th:value="${movie.year}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">这里填写上映时间</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">剧情</label>
                                    <div class="col-md-6 col-xs-12">
                                        <textarea class="form-control" rows="5" name="content" th:if="${isEdit} eq 'add'"></textarea>
                                        <textarea class="form-control" rows="5" name="content" th:text="${movie.content}" th:if="${isEdit} eq 'edit'"></textarea>
                                        <span class="help-block">这里填写剧情介绍</span>
                                    </div>
                                </div>

                            </div>
                            <div class="panel-footer">
                                <button class="btn btn-default" type="reset">Clear Form</button>
                                <button class="btn btn-primary pull-right" type="submit">Submit</button>
                            </div>
                        </div>
                    </form>

                </div>
            </div>

        </div>

    </div>
</div>
</body>
</html>